package com.mydemo.design_pattern.structure_type.adapter_pattern.impl;

import com.mydemo.design_pattern.structure_type.adapter_pattern.IMediaPlayer;
import com.mydemo.design_pattern.structure_type.adapter_pattern.MediaAdapter;

/**
 * <p></p >
 *
 * @author liming1
 * @version $Id: MediaPlayer, v1.0 2019-09-18 16:12 liming1 Exp $
 */
public class MediaPlayer implements IMediaPlayer {

    private IMediaPlayer mediaAdapter;

    @Override
    public void play(String type) {
        if ("mp3".equals(type)){
            System.out.println("mp3");
        }else {
            MediaAdapter mediaAdapter = new MediaAdapter(type);
            mediaAdapter.play(type);
        }
    }
}
